<?php defined('INDEX_FILE') or die('forbidden');


/**
* MLT Web Engine
* http://www.molotsoft.ru
*
* @package MLT_WE
* @subpackage PHP_Compat_Loader
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: php_compat_loader.inc.php 22 2009-02-20 08:40:20Z molotsoft@gmail.com $
* @link $HeadURL: http://php-compat-loader.googlecode.com/svn/tags/latest/php_compat_loader.inc.php $
*/


define('CLDR_PACKAGE', 'PHP_Compat_Loader');
define('CLDR_VERSION', '1.0.1');

define('CLDR_PHP_VERSION', '4.0.7');
version_compare(PHP_VERSION, CLDR_PHP_VERSION, '>=') or trigger_error('required PHP_VERSION >= ' . CLDR_PHP_VERSION, E_USER_NOTICE);


define('CLDR_ROOT_DIR', pathinfo(__FILE__, PATHINFO_DIRNAME) . '/');
define('CLDR_PHP_EXT', '.' . pathinfo(__FILE__, PATHINFO_EXTENSION));

define('CLDR_COMPAT_DIR', CLDR_ROOT_DIR . 'Compat/');
define('CLDR_COMPAT_FUNCS_DIR', CLDR_COMPAT_DIR . 'Function/');
define('CLDR_COMPAT_CONSTS_DIR', CLDR_COMPAT_DIR . 'Constant/');
define('CLDR_COMPAT_EXT', CLDR_PHP_EXT);


$components = array('function' => array(), 'constant' => array());

require_once(CLDR_COMPAT_DIR . 'Components' . CLDR_COMPAT_EXT);

foreach ($components['function'] as $name => $version) {
	if (is_file(CLDR_COMPAT_FUNCS_DIR . $name . CLDR_COMPAT_EXT) && version_compare(PHP_VERSION, $version, '<')) {
		require_once(CLDR_COMPAT_FUNCS_DIR . $name . CLDR_COMPAT_EXT);
	}
}

foreach ($components['constant'] as $name => $version) {
	if (is_file(CLDR_COMPAT_CONSTS_DIR . $name . CLDR_COMPAT_EXT) && version_compare(PHP_VERSION, $version, '<')) {
		require_once(CLDR_COMPAT_CONSTS_DIR . $name . CLDR_COMPAT_EXT);
	}
}

unset($components, $name, $version);


?>